<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateRefundDetailsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('refund_details', function (Blueprint $table) {
            $table->id();
            $table->unsignedBigInteger('refunds_id')->index()->comment('父ID');
            $table->string('order_no')->index()->comment('订单号');
            $table->string('refund_no')->index()->comment('退款单号');
            $table->integer('refund_amount')->comment('退款金额.单位：分');
            $table->string('refund_platform')->comment('退款平台');
            $table->tinyInteger('status')->default(0)->comment('退款状态:0-退款中；1-退款成功；2-退款失败');
            $table->string('trade_no')->nullable()->comment('退款平台生成的订单序列号');
            $table->longText('fail_memo')->nullable();
            $table->text('tenders')->nullable();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {

    }
}
